package cn.rocksolid.proxy.restful.assist;

import cn.rocksolid.sport.assist.entity.OssEntity;
import cn.rocksolid.sport.assist.service.OssService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * OSS controller
 *
 * @author Axl Zhao
 * @email axl.zhao@163.com
 */
@RestController
@RequestMapping("assist/oss")
@RequiresAuthentication
public class OssController {

  private final OssService ossService;

  @Autowired
  public OssController(final OssService ossService) {
    this.ossService = ossService;
  }

  @PostMapping("/credential")
  public Object credential(@RequestBody final OssEntity ossEntity) {
    return ossService.credential(ossEntity);
  }
}
